package com.wc.alorithm_blue_bridge._模拟.Q6274;

import java.util.TreeSet;

/**
 * @Author congge
 * @Date 2024/2/23 23:12
 * @description https://www.lanqiao.cn/problems/6274/learning/?page=1&first_category_id=1
 */
public class Main {
    public static void main(String[] args) {
        TreeSet<Integer> set = new TreeSet<>();

        for (int i = 1; i <= 20; i++) {
            for (int j = i - 2; j <= i + 2; j++) {
                for (int k = j - 2; k <= j + 2; k++) {
                    if (Math.abs(i - j) <= 2 && Math.abs(i - k) <= 2 && Math.abs(k - j) <= 2 && j > 0 && k > 0) {
                        set.add(i * j * k);
                    }
                }
            }
        }
        int idx = 1;
        for (int num : set) {
            if (idx == 23) {
                System.out.println(num);
                break;
            }
            System.out.print(num + " ");
            idx++;
        }
    }
}
